<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Thanh Luan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <link rel="stylesheet" type="text/css" href="../scripts/tabs/slidingtabs-horizontal.css">
        <script type="text/javascript" src="../scripts/tabs/slidetab.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <link rel="stylesheet" type="text/css" href="../css/dropdown.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript">
            $j(document).ready(function() {
                initThickBox('.thickbox');
                $j(".department2").live("click", function() {

                    fh200 = $j(".donvi").attr("lang");
                    fn850 = $j(this).attr("lang");
                    fn450 = $j(".department1").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    //   showPleaseWait(); 
                    $j.post("N450_N850.jsp?&action=group&fh200=" + fh200 + "&fn450=" + fn450 + "&fn850=" + fn850, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                            //       hidePleaseWait();        
                        }
                    });
                });
                $j('.loadproject').live('click', function() {
                    fis = $j(this).attr('lang');
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    showPleaseWait();
                    window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                });
                $j(".department3").live("click", function() {
                    fh200 = $j(".donvi").attr("lang");
                    fn850 = $j(this).attr("lang");
                    fn450 = $j(".department1").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    $j.post("N450_N850.jsp?&action=group&fh200=" + fh200 + "&fn450=" + fn450 + "&fn850=" + fn850, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                        }
                    });
                });
                $j(".cbx_editEmp").live("change", function() {
                    fn850 = $j(".department2").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    showPleaseWait();
                    $j.post("N450_N850.jsp?fn850=" + fn850 + "&emp=" + emp, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                            hidePleaseWait();
                        }
                    });
                });
                $j('.text_search').live('keyup', function() {
                    if ($j('.text_search').val() == "") {
                        $j('.noteRow').show();
                        $j('.close').trigger('click');

                    } else {
                        $j('.close').trigger('click');
                        $j('.noteRow').hide();
                        $j('.noteRow').each(function() {
                            html = $j(this).html();
                            if (ununicode(html).indexOf(ununicode($j('.text_search').val())) > -1) {
                                $j(this).show();
                            } else {
                                $j(this).hide();
                            }
                        });
                    }

                });
                $j('.icondots').live('hover', function() {
                    $j(this).next('.addgroup').css('display', 'block');
                    $j(this).next('.addgroup').css('z-index', '999');
                });
                $j('.icondots').live('mouseout', function() {
                    $j(this).next('.addgroup').css('display', 'none');
                });
                $j('.search_boxp').hide();
                $j('.sidebar_search').live('click', function() {
                    $j('.search_boxp').hide();
                    if ($j(this).next().hasClass('active')) {

                        $j('.search_boxp').removeClass('active');
                    } else {

                        $j('.search_boxp').removeClass('active');
                        $j(this).next().addClass('active');
                        $j(this).next().show();
                    }
                });
            });
        </script>

    </head>
    <body>
        <a4j:form>
            <div id="content">
            <%-- progress dialog--%>
            <a4j:status onstart="#{rich:component('statPane')}.show()" onstop="#{rich:component('statPane')}.hide()" />
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <div id="menutop_top">
                <div class="div_search_menutop">
                    <div class="item_search">

                        <h:inputText onfocus="if(this.value=='search') this.value='';" style="float:left;" value="search"/>
                        <div style="float:left;border: 1px solid #50678A;"> <h:graphicImage style="float:left;" value="../images1/btn_search.png"/></div>
                    </div>

                </div>
                <div class="icon_action">
                    <h:panelGroup>

                        <h:selectOneMenu id="N1000" value="#{m020Controller.userchoose}" style="width:180px;height:26px;"  styleClass="cbx_editEmp">
                            <f:selectItems value="#{c150Controller.combN100Pro}" />

                        </h:selectOneMenu>
                    </h:panelGroup>
                </div>
                <div class="icon_action">
                    <div style="float:left;margin-right: 2px;margin-left: 2px;" class="imgFancybox">
                        <h:outputLink  value="editworkProject.jsp?action=addnew&page=project.jsp&height=5px&width=600px" styleClass="fancybox add_new" id="fancybox1">
                            <h:graphicImage title="Add công vi?c" value="../images/icon_addTour.png"/>
                        </h:outputLink>
                    </div>
                </div>
                <div class="icon_action">
                    <div class="classimageSMS">
                        <img src="../images/smsnew.png" class="sendSMS_person" lang="page=sendSMSitemEmployee" title="Xác nh?n  SMS"/>
                    </div>
                </div>


            </div>

            <div id="menutop">
                <div class="dropdown">
                    <div class="select_choise">
                        <a href="#"><span>Khu vực</span></a>
                    </div>
                    <div class="select_hidden">
                        <ul>

                            <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            <li><a href="#"><span>Filter Cấp 3</span></a></li>
                        </ul>
                    </div>
                </div>
                <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#">
                                <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                    <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                    <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/>
                                </span>
                            </a>

                        </div>
                        <div class="select_hidden departmentlistN850">

                            <ul>
                                <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                            <h:outputText value="Tất cả"/>
                                        </span></a></li>                          


                                <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                    <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                <h:outputText value="#{item.label}"/>
                                            </span></a></li> 
                                        </a4j:repeat>
                            </ul>
                        </div>
                    </div>
                </h:panelGroup>
            </div>
            <div style="width: 100%; margin-top: 30px;">
                <rich:tabPanel selectedTab="#{m020Controller.tabString}" switchType="ajax">

                    <rich:tab name="TABSSMS" action="#{m020Controller.chooseTabssms}" label="SMS SEND" style="height: 67%;">
                        <div style="width:100%">
                            <div class="headerdivtable">
                                <div class="itemheaderdivtable_center" style="width: 4.9%;">
                                    <h:outputText value="STT"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 19.75%;">
                                    <h:outputText value="FULLNAME"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 9.88%;">
                                    <h:outputText value="PHONE"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 9.88%;">
                                    <h:outputText value="TITLE"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 9.89%;">
                                    <h:outputText value="CONTENT"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 14.85%;">
                                    <h:outputText value="M?C ÐÍCH"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 9.85%;">
                                    <h:outputText value="STATUS"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 9.9%;">
                                    <h:outputText value="ACTION"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 7.75%;">
                                    <h:outputText value="UPDATE"/>
                                </div>
                            </div>
                            <div class="headerdivtable_over" style="overflow: auto;height: 500px;">
                                <a4j:repeat  value="#{m020Controller.listoftabM020}" var="item" rowKeyVar="index">  
                                    <div class="headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                        <div class="itemheaderdivtable_center " style="width: 5%;color:#0055A6;">
                                            <h:outputText value="#{index+1} "/> 
                                        </div> 
                                        <div class="itemheaderdivtable_center " style="width: 20%;color:#0055A6;">
                                            <h:panelGroup rendered="#{item.fn600==2}"><h:outputLink value="customer.jsp?action=linkCus&pnPN100=#{item.fn100}&type=#{item.ni104}"> <h:outputText value="#{item.hoten}" /></h:outputLink></h:panelGroup>
                                            <h:panelGroup rendered="#{item.fn600==1}"><h:outputLink style="color:#E2CC3D;font-weight:bold;" value="employee.jsp?action=linkEmp&pnPN100=#{item.fn100}"> <h:outputText  value="#{item.hoten}"/></h:outputLink></h:panelGroup>
                                            <h:panelGroup rendered="#{item.fn600==0}"><h:outputLink style="color:#E2CC3D;font-weight:bold;"  value="employee.jsp?action=linkEmp&pnPN100=#{item.fn100}"> <h:outputText  value="#{item.hoten}" /></h:outputLink></h:panelGroup>  
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 10%;color:#0055A6;">
                                            <h:outputText value="#{item.nv121}"/>
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 10%;color:#0055A6;">
                                            <h:outputText value="#{item.mv021}"/>
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 10%;color:#0055A6;">
                                            <h:outputText value="#{item.mv022}"/>
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 15%;color:#0055A6;">
                                            <h:panelGroup rendered="#{item.mn026==1}">  <h:outputText value="Ngu?i tham gia Tour"/></h:panelGroup>
                                            <h:panelGroup rendered="#{item.mn026==2}">  <h:outputText value="Hàng không"/></h:panelGroup>
                                            <h:panelGroup rendered="#{item.mn026==3}">  <h:outputText value="Phòng ?c"/></h:panelGroup>
                                            <h:panelGroup rendered="#{item.mn026==4}">  <h:outputText value="Th? t?c visa"/></h:panelGroup>
                                            <h:panelGroup rendered="#{item.mn026==5}">  <h:outputText value="Xe bus"/></h:panelGroup>
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 10%;color:#0055A6;">
                                            <h:outputText value="#{item.mv025}"/>
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 10%;color:#0055A6;">
                                            <h:panelGroup rendered="#{item.mv025!='SMS SUCCESS'}">   
                                                <img src="../images/viewSMS.png" class="sendSMS1" lang="action=sendSMSfail&p=A&group=1&phone=<h:outputText value="#{item.nv121}"/>&fn100=<h:outputText value="#{item.fn100}"/>&pm020=<h:outputText value="#{item.pm020}"/>" style="cursor: pointer;" title="Xác nh?n  SMS"/>
                                            </h:panelGroup>
                                        </div>
                                        <div class="itemheaderdivtable_center " style="width: 6.5%;color:#0055A6;">
                                            <h:outputText value="#{item.ml029}"/></br>
                                            <h:outputText value="#{item.ml028}"/>
                                        </div>

                                    </div>
                                </a4j:repeat>
                            </div>
                        </div>
                    </rich:tab>
                    <rich:tab name="TABRSMS" action="#{m020Controller.chooseTabrsms}" label="INBOX SMS">
                        <h:panelGroup id="sms">
                            <div style="width:100%;float: left;">
                                <div style="width:100%">
                                    <a4j:commandButton action="#{m020Controller.updateSMSreceiveforFibo}" reRender="sms" value="GET SMS FOR FIBO"/>
                                    <a4j:commandButton action="#{m020Controller.deleteSMS}" reRender="sms" value="ALL DELETE"/>
                                </div>
                                <div class="headerdivtable">
                                    <div class="itemheaderdivtable_center" style="width: 4.9%;">
                                        <h:outputText value="NUM"/>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 9.88%;">
                                        <h:outputText value="ACTION"/>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 9.9%;">
                                        <h:outputText value="NUMBER"/>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 58.3%;">
                                        <h:outputText value="CONTENT"/>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 4.95%;">
                                        <h:outputText value="STATUS"/>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 9.78%;">
                                        <h:outputText value="DATE"/>
                                    </div>

                                </div>
                                <div class="headerdivtable_over" style="overflow: auto;height:500px;">
                                    <a4j:repeat  value="#{m020Controller.listoftabM020Receive}" var="item" rowKeyVar="index">    
                                        <div class="headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                            <div class="itemheaderdivtable_center " style="width: 5%;color:#0055A6;">
                                                <h:outputText value="#{index+1} "/>
                                            </div>
                                            <div class="itemheaderdivtable_center " style="width: 10%;color:#0055A6;">
                                                <h:outputLink  value="delete.jsp?id=#{item.pm020}&flag=M020&width=300&height=150" styleClass="fancybox">
                                                    <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                </h:outputLink>
                                            </div>
                                            <div class="itemheaderdivtable_left " style="width: 10%;color:#0055A6;">
                                                <h:panelGroup rendered="#{item.mv031!='O'}"><h:outputText value="#{item.mv021}"/></h:panelGroup>
                                                <h:panelGroup rendered="#{item.mv031=='O'}"><h:outputText style="color:red;font-weight:bold;" value="#{item.mv021}"/></h:panelGroup>
                                            </div>
                                            <div class="itemheaderdivtable_left " style="width: 59%;color:#0055A6;">
                                                <h:panelGroup rendered="#{item.mv031!='O'}"> <h:outputText value="#{item.mv022}"/> </h:panelGroup>
                                                <h:panelGroup rendered="#{item.mv031=='O'}"> <h:outputText style="color:#0B77E3;font-weight:bold;" value="#{item.mess}"/> </h:panelGroup>
                                            </div>
                                            <div class="itemheaderdivtable_center " style="width: 5%;color:#0055A6;">
                                                <h:panelGroup rendered="#{item.mv031!='O'}"> 

                                                    <h:graphicImage title="Ðã xem" value="../images/letter_open.png"/>

                                                </h:panelGroup>
                                                <h:panelGroup rendered="#{item.mv031=='O'}"> 
                                                    <a4j:commandLink reRender="sms" action="#{m020Controller.readsmsforFibo}">
                                                        <f:param name="action" value="getidreadfile"/>
                                                        <f:param name="pm020" value="#{item.pm020}"/>
                                                        <h:graphicImage title="Chua xem" value="../images/letter.png"/>
                                                    </a4j:commandLink>

                                                </h:panelGroup>
                                            </div>
                                            <div class="itemheaderdivtable_center" style="width: 8.7%;color:#0055A6;">
                                                <h:panelGroup rendered="#{item.mv031!='O'}"> <h:outputText value="#{item.md023}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText></h:panelGroup>
                                                <h:panelGroup rendered="#{item.mv031=='O'}"> <h:outputText style="color:#0B77E3;font-weight:bold;" value="#{item.md023}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText></h:panelGroup>
                                            </div>
                                        </div>


                                    </a4j:repeat>
                                </div>
                            </div>

                        </h:panelGroup>
                    </rich:tab>
                </rich:tabPanel>
                <%-- progress dialog --%>
                <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                 height="30" width="40" zindex="2000">
                    <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                </rich:modalPanel>
                <rich:modalPanel styleClass="pleaseimage" id="statPane" autosized="true" minHeight="10" minWidth="80"
                                 height="10" width="80" zindex="2000">
                    <h:graphicImage value="/images/loadingAnimation.gif" alt="ai" />
                </rich:modalPanel>
            </div>
        </div>
        </a4j:form>
    </body>
</html>
